#include "reg52.h"

sbit L1 = P0^0;
sbit L8 = P0^7;

unsigned int i = 0;
void Delay(unsigned int n)
{
	while(n--);
	while(n--);
}

void Show_LED1()
{
	P2 = (P2 & 0x1f) | 0x80;
	L1 = 0;
	Delay(60000);
	Delay(60000);
		L1 = 1;
	Delay(60000);

}
void Init_INT0()
{
	EA = 1;
	IT0 = 1;
	EX0 = 1;
}

void serve_INT0() interrupt 0
{
	i = 1;
}

void DelayLED1()
{
	if(i == 1)
	{
	L8 = 0;
	Delay(60000);
	Delay(60000);
	Delay(60000);		
	Delay(60000);
	L8 = 1;
	}	
	i = 0;
}

void main()
{

	Init_INT0();
	while(1)
	{
		Show_LED1();
		DelayLED1();
		
	}
}